/**
 * 基础增删查改api类
 */

import Instance from '@/util/request';

export default {
  // 登录
  login (params) {
    return Instance.post({ url: `/admin/login`, params });
  },
  // 退出登录
  logout (params) {
    return Instance.post({ url: `/admin/logout`, params });
  },
  batchOptionContentText (params) {
    return Instance.post({ url: `/admin/contentext/batchOptionContentText`, params });
  },
  // 官方消息
  officalNews (params) {
    return Instance.get({ url: `/admin/officialNews/list`, params });
  },
  addOfficalNews (params) {
    return Instance.post({ url: `/admin/officialNews`, params });
  },
  modOfficalNews (id, params) {
    return Instance.put({ url: `/admin/officialNews/${id}`, params });
  },
  // 删除官方消息
  deleteOfficalNews (params) {
    return Instance.post({ url: `/admin/officialNews/batch-delete`, params });
  },
  // 获取在线反馈列表
  onlineFeedBackList (params) {
    return Instance.get({ url: `/admin/feedBack`, params });
  },
  editFeedBack (id, params) {
    return Instance.put({ url: `/admin/feedBack/${id}`, params });
  },
  // 在线反馈批量删除
  deleteFeedBack (params) {
    return Instance.post({ url: `/admin/feedBack/batch-delete`, params });
  },
  // 统计列表
  countList (params) {
    return Instance.post({ url: `/admin/count/list`, params });
  },

  systemInfo (params) {
    return Instance.get({ url: `/admin/system/info`, params });
  },

  systemSave (id, params) {
    return Instance.put({ url: `/admin/system/${id}`, params });
  },

  // 版本列表
  getVersionList (params) {
    return Instance.post({ url: `/admin/version/list`, params });
  },

  addVersion (params) {
    return Instance.post({ url: `/admin/version`, params });
  },

  versionEnable (id, params) {
    return Instance.put({ url: `/admin/version/${id}`, params });
  },

  // 批量删除版本管理
  versionDelete (params) {
    return Instance.post({ url: `/admin/version/batch-delete`, params });
  },

  getHelpList (params) {
    return Instance.get({ url: `/admin/help/list`, params });
  },

  addHelp (params) {
    return Instance.post({ url: `/admin/help`, params });
  },

  modHelp (id, params) {
    return Instance.put({ url: `/admin/help/${id}`, params });
  },

  deleteHelp (params) {
    return Instance.post({ url: `/admin/help/batch-delete`, params });
  },

  getUserList (params) {
    return Instance.get({ url: `/admin/user/normal-list`, params });
  },

  getPayment (params) {
    return Instance.get({ url: `/admin/payment`, params });
  },

  deleteUser (params) {
    return Instance.post({ url: `/admin/user/batch-delete`, params });
  },

  getVipList (params) {
    return Instance.get({ url: `/admin//user/vip-list`, params });
  },

  getShareList (params) {
    return Instance.get({ url: `/admin/user/share-list`, params });
  },

  getInviteList (params) {
    return Instance.get({ url: `/admin/user/invite-list`, params });
  },

  resetPassword (params) {
    return Instance.get({ url: `/user/invite-list`, params });
  },

  getFileList (params) {
    return Instance.get({ url: `/admin/file`, params });
  },

  deleteFileList (params) {
    return Instance.post({ url: `/admin/file/batch-delete`, params });
  },

  withdrawList (params) {
    return Instance.get({ url: `/admin/withdrawApply`, params });
  },

  withdrawApply (id, params) {
    return Instance.put({ url: `/admin/withdrawApply/${id}`, params });
  },

  scriptStatistics (params) {
    return Instance.get({ url: `/admin/statistics/folder/view`, params });
  },

  scriptChart (params) {
    return Instance.get({ url: `/admin/statistics/folder/line`, params });
  },

  userChart (params) {
    return Instance.get({ url: `/admin/statistics/user/line`, params });
  },

  userStatistics (params) {
    return Instance.get({ url: `/admin/statistics/user/view`, params });
  },

  memberStatistics (params) {
    return Instance.get({ url: `/admin/statistics/member/view`, params });
  },

  memberChart (params) {
    return Instance.get({ url: `/admin/statistics/member/line`, params });
  },

  shareStatistics (params) {
    return Instance.get({ url: `/admin/statistics/share/view`, params });
  },

  shareChart (params) {
    return Instance.get({ url: `/admin/statistics/share/line`, params });
  },

  incomeStatistics (params) {
    return Instance.get({ url: `/admin/statistics/income/view`, params });
  },

  incomeChart (params) {
    return Instance.get({ url: `/admin/statistics/income/line`, params });
  },
  fileUpload (params) {
    return Instance.post({ url: `/admin/oss/upload`, params });
  },
  bannerList (params) {
    return Instance.get({ url: `/admin/banner/list`, params });
  },
  bannerDetail (params) {
    return Instance.get({ url: `/admin/banner/${params.id}`, params });
  },
  bannerDelete (params) {
    return Instance.delete({ url: `/admin/banner/${params.id}` });
  },
  bannerAdd (params) {
    return Instance.post({ url: `/admin/banner`, params });
  },
  bannerUpdate (params) {
    return Instance.put({ url: `/admin/banner/${params.id}`, params });
  },
};
